FROM node:latest as v7-builder
WORKDIR /app
COPY package.json .
RUN npm install cnpm -g
RUN cnpm install
COPY . .
RUN npm run build

FROM nginx:1.16.0
COPY k8s/prod/nginx.conf /etc/nginx/nginx.conf
COPY k8s/prod/_.7moor.com.crt /usr/share/nginx/conf/_.7moor.com.crt
COPY k8s/prod/_.7moor.com.key /usr/share/nginx/conf/_.7moor.com.key
COPY --from=v7-builder /app/dist /usr/share/nginx/html
EXPOSE 80
EXPOSE 443
RUN echo 'echo init ok!!'
